package ThreadStart;

public class ThreadDemo extends Thread
{
    //方法1 通过继承Thread类，重写run方法，调用start实现
    public void run()
    {
        super.run();
        System.out.println("子线程");
    }

    public static void main(String[] args)
    {
        //创建对象
        ThreadDemo threadDemo =new ThreadDemo();
        //调用代码，开辟子线程
        threadDemo.start();

        System.out.println("父线程");
    }
}
